package com.zzl.study.nacos.config;

import com.zzl.study.nacos.NacosServiceMultiManager;
import com.zzl.study.nacos.condition.ConditionalOnNacosMultiDiscoveryEnabled;
import org.springframework.boot.autoconfigure.AutoConfigureBefore;
import org.springframework.cloud.client.ConditionalOnDiscoveryEnabled;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * Nacos服务自动配置类
 *
 * @author: zhangzl
 * @date: 2025/7/15 15:14
 * @version: 1.0
 */
@Configuration(proxyBeanMethods = false)
@ConditionalOnDiscoveryEnabled
@ConditionalOnNacosMultiDiscoveryEnabled
@AutoConfigureBefore(NacosMultiDiscoveryAutoConfiguration.class)
public class NacosServiceAutoConfiguration {

    /**
     * 向Spring容器中注入一个Nacos服务多注册中心管理类
     *
     * @return Nacos服务多注册中心管理类
     */
    @Bean
    public NacosServiceMultiManager nacosServiceMultiManager() {
        return new NacosServiceMultiManager();
    }

}
